import './utils/utils'
import './utils/http'
// app.js
App({
  globalData: {},
  onLaunch(){
    this.getToken()
  },
  getToken() {
    const token = wx.getStorageSync('token')
    console.log('asdas' + token);
    this.token = token
  },
  setToken(t, refresh_token) {
    // 拼凑合法token格式
    t = `Bearer ${t}`
    refresh_token = 'Bearer ' + refresh_token
    // 本地存储 token 和 refresh_token
    wx.setStorageSync('token', t)
    wx.setStorageSync('refresh_token', refresh_token)
    // 更新全局 token 和 refresh_token
    this.token = t
    this.refresh_token = refresh_token
  }
})
